<template>
  <yd-layout class="m-reset">
    <!-- 顶部导航 -->
    <yd-navbar slot="navbar" title="商家档案" height=".88rem" bgcolor="#fff" color="#444" fontsize=".3rem">
      <yd-navbar-back-icon slot="left" color="#666" @click.native="$router.back()"></yd-navbar-back-icon>
    </yd-navbar>

    <yd-cell-group>
      <yd-cell-item>
        <span slot="left">公司名称：{{storeInfo.company}}</span>
      </yd-cell-item>
      <yd-cell-item>
        <span slot="left">营业执照：{{storeInfo.licenseNumber}}</span>
      </yd-cell-item>
      <yd-cell-item>
        <span slot="left">员工人数：{{storeInfo.employeesNum}}</span>
      </yd-cell-item>
      <div class="u-gap"></div>
      <yd-cell-item>
        <span slot="left">店铺介绍：{{storeInfo.shopIntroduction}}</span>
      </yd-cell-item>
      <yd-cell-item>
        <span slot="left">主营行业：{{storeInfo.mainIndustry}}</span>
      </yd-cell-item>
      <yd-cell-item>
        <span slot="left">产品风格：{{storeInfo.productStyle}}</span>
      </yd-cell-item>
      <yd-cell-item>
        <span slot="left">主营产品：{{storeInfo.mainProducts}}</span>
      </yd-cell-item>
      <yd-cell-item>
        <span slot="left">主要客户群体：{{storeInfo.mainCustomerGroups}}</span>
      </yd-cell-item>
      <div class="u-gap"></div>
      <yd-cell-item>
        <span slot="left">月均产量：{{storeInfo.monthProduction}}件</span>
      </yd-cell-item>
      <yd-cell-item>
        <span slot="left">年营业额：{{storeInfo.yearSales}}元</span>
      </yd-cell-item>
      <yd-cell-item>
        <span slot="left">年出口额：{{storeInfo.yearExportNum}}元</span>
      </yd-cell-item>
    </yd-cell-group>
  </yd-layout>
</template>

<script>
  import { apiShopRecord } from 'js/api'
  
  export default {
    data() {
      return {
        storeId: '',
        storeInfo: {}
      }
    },
    created() {
      this.storeId = this.$route.params.id + ''
      if (this.$store.getters.userRole != 'BUYER') {
        this.$toast('您不是采购商，请先升级采购商', () => {
          this.$router.replace('/member')
        })
        return
      }
      if (!this.storeId) {
        this.$toast('该店铺不存在，请重新查询', () => {
          this.$router.replace('/')
        })
        return
      }
      apiShopRecord(this.storeId).then(data => {
        this.storeInfo = data.StoreArchives || {}
      })
    }
  }
</script>

<style lang="scss">
  
</style>